<script>
function isOkay()
{    
    return true;
}
//========================================================================================
function saveRecord(bitClose)
{
    if(isOkay())
    {
        var f = document.forms["main_form"]
        f.close_record.value = bitClose ? "1" : "0"
        f.submit();
    }
}
//========================================================================================
function deleteRecord()
{
    alert("You can not delete anything...It's a new record")
}
//========================================================================================
function closeRecord()
{
    window.location='list'
}
</script>
<form name='main_form' action='edit_save' method='POST'>
    <input type="hidden" name="key" value="{{record.key}}">
    <input type="hidden" name="close_record" value="0">
    <a href="new">[Add]</a>
    <a href="javascript:saveRecord(false);">[Save]</a>
    <a href="javascript:saveRecord(true);">[Save & Close]</a>
    <a href="javascript:deleteRecord();">[Delete]</a>
    <a href="javascript:closeRecord()">[Close]</a>
<hr>
<table>
        <% for col in @data_set.Tables[0].Columns %>
	<tr>
	    <td><%= col.ColumnName %>:</td>
	    <td><input type='text' name='<%= col.ColumnName %>' id='<%= col.ColumnName %>' size='50' value='{{record.<%= col.ColumnName %>}}'></td>
	</tr>
	<% end %>
</table>
</form>